package com.vip.userregist.dao.impl;

import java.util.HashMap;
import java.util.List;

import com.vip.buycart.entity.User;
import com.vip.framework.generic.GenericDaoImpl;

/**
 * 用户DaoImpl
 * 
 * @author sai
 *
 */
public class LoginDAOImpl extends GenericDaoImpl<User> {

	public LoginDAOImpl(User t) {
		super(t);
	}

	/* (non-Javadoc)
	 * @see com.vip.framework.generic.GenericDaoImpl#search(java.util.HashMap, int, int)
	 */
	@Override
	public List<User> search(HashMap<String, String> con, int page,
			int rowsPerPage) {
		
		StringBuffer sql = new StringBuffer();
        sql.append(" FROM User u WHERE 1=1 ");
        if (null != con.get("name") && !"".equals(con.get("name"))) {
            sql.append(" AND u.name = '").append(con.get("name"))
                    .append("'");
        }
        //TODO :改成按更新时间降序排列
        return executeHQL(sql.toString());
		
	}

	
}
